#!/bin/sh

set -e

# Compile and install a custom udev-watchdog program

echo "Compiling and installing a custom udev-watchdog program"

apt-get install --yes build-essential binutils libudev-dev

SRC="/usr/src/udev-watchdog.c"
DST="/usr/local/sbin/udev-watchdog"

gcc -o "$DST" "$SRC" -Wall -ludev -lrt
strip --strip-all "$DST"

apt-get --yes purge libudev-dev
